import React, { useState } from "react";

export default function UseStateHookComp() {
  const [count, setCount] = useState(0);
  // 当然也可以定义多个 state
  const [title, setTitle] = useState("计数面板");
  return (
    <div>
      <header>{title}</header>
      <h3>{count}</h3>
      <button
        onClick={() => {
          setCount(count + 1);
        }}
      >
        click me
      </button>
    </div>
  );
}
